﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebApp.Models
{
    public class ResultModel
    {
        /// <summary>
        /// 状态码
        /// </summary>
        public string code { get; set; } = "500";
        /// <summary>
        /// 0 失败，1 成功 ，2 自定义...99 weizhi
        /// </summary>
        public int result { get; set; } = (int)MsgType.error;
        /// <summary>
        /// 数据集
        /// </summary>
        public dynamic data { get; set; }
        /// <summary>
        /// 消息
        /// </summary>
        public string msg { get; set; } 
        /// <summary>
        /// 自动关闭时间
        /// </summary>
        public int time { get; set; } = 1500;
        /// <summary>
        /// 显示标题
        /// </summary>
        public string title { get; set; } 
        /// <summary>
        /// 提示类型
        /// </summary>
        public string type { get; set; } = MsgType.error.ToString();
        /// <summary>
        /// 提示图表地址
        /// </summary>
        public string icon { get; set; }

    }
    public enum MsgType
    {
        /// <summary>
        /// 错误提示
        /// </summary>
        error = 0,
        /// <summary>
        /// 成功提示
        /// </summary>
        success = 1,
        /// <summary>
        /// 温馨提示
        /// </summary>
        info = 2,
        /// <summary>
        /// 警告提示
        /// </summary>
        warning = 3,
        /// <summary>
        /// 自定义
        /// </summary>
        unspecified=9
    }
    public enum ResultType
    {
        error = 0,
        success = 1,
        unspecified=9

    }
}
